home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Development Kits / MPW etc. / MPW-GM / Interfaces&Libraries / Interfaces / CIncludes / ConditionalMacros.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-17  |  40.9 KB  |  1,328 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ConditionalMacros.h
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Technology:    Universal Interface Files 3.1
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1993-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __CONDITIONALMACROS__
  19. #define __CONDITIONALMACROS__
  20.  
  21. /****************************************************************************************************
  22.     UNIVERSAL_INTERFACES_VERSION
  23.     
  24.         0x0310 => version 3.1
  25.         0x0301 => version 3.0.1
  26.         0x0300 => version 3.0
  27.         0x0210 => version 2.1
  28.         This conditional did not exist prior to version 2.1
  29. ****************************************************************************************************/
  30. #define UNIVERSAL_INTERFACES_VERSION 0x0310
  31.  
  32. /****************************************************************************************************
  33.  
  34.     TARGET_CPU_≈    
  35.     These conditionals specify which microprocessor instruction set is being
  36.     generated.  At most one of these is true, the rest are false.
  37.  
  38.         TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  39.         TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  40.         TARGET_CPU_X86            - Compiler is generating x86 instructions
  41.         TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  42.         TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  43.         TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  44.  
  45.  
  46.     TARGET_OS_≈    
  47.     These conditionals specify in which Operating System the generated code will
  48.     run. At most one of the these is true, the rest are false.
  49.  
  50.         TARGET_OS_MAC            - Generate code will run under Mac OS
  51.         TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  52.         TARGET_OS_UNIX            - Generate code will run under some unix 
  53.  
  54.  
  55.     TARGET_RT_≈    
  56.     These conditionals specify in which runtime the generated code will
  57.     run. This is needed when the OS and CPU support more than one runtime
  58.     (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  59.  
  60.         TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  61.         TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  62.         TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  63.         TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  64.  
  65.  
  66.     PRAGMA_≈
  67.     These conditionals specify whether the compiler supports particular #pragma's
  68.     
  69.         PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  70.         PRAGMA_ONCE              - Compiler supports: #pragma once
  71.         PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  72.         PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  73.         PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  74.         PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  75.         PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  76.         PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  77.  
  78.     FOUR_CHAR_CODE
  79.     This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  80.     is compiled down to the correct value on all compilers.
  81.  
  82.         FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  83.  
  84.     TYPE_≈
  85.     These conditionals specify whether the compiler supports particular types.
  86.  
  87.         TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  88.         TYPE_BOOL                - Compiler supports "bool"
  89.         TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  90.  
  91. ****************************************************************************************************/
  92.  
  93. #if defined(__MRC__)
  94.     /*
  95.         MrC[pp] compiler from Apple Computer, Inc.
  96.     */
  97.     #define TARGET_CPU_PPC              1
  98.     #define TARGET_CPU_68K              0
  99.     #define TARGET_CPU_X86              0
  100.     #define TARGET_CPU_MIPS             0
  101.     #define TARGET_CPU_SPARC            0        
  102.     #define TARGET_CPU_ALPHA            0
  103.     #define TARGET_OS_MAC                1
  104.     #define TARGET_OS_WIN32                0
  105.     #define TARGET_OS_UNIX                0
  106.     #define TARGET_RT_LITTLE_ENDIAN        0
  107.     #define TARGET_RT_BIG_ENDIAN        1
  108.     #define TARGET_RT_MAC_CFM            1
  109.     #define TARGET_RT_MAC_68881            0
  110.     #if (__MRC__  > 0x0200) && (__MRC__ < 0x0700)
  111.         #define PRAGMA_IMPORT            1
  112.     #else
  113.         #define PRAGMA_IMPORT            0
  114.     #endif
  115.     #define PRAGMA_STRUCT_ALIGN            1
  116.     #define PRAGMA_ONCE                    1
  117.     #define PRAGMA_STRUCT_PACK            0
  118.     #define PRAGMA_STRUCT_PACKPUSH        0
  119.     #define PRAGMA_ENUM_PACK            1
  120.     #define PRAGMA_ENUM_ALWAYSINT        0
  121.     #define PRAGMA_ENUM_OPTIONS            0
  122.     #define FOUR_CHAR_CODE(x)            (x)
  123.         
  124.     #if (__MRC__  > 0x0300) && (__MRC__ < 0x0700)
  125.         #if __option(longlong)
  126.             #define TYPE_LONGLONG        1
  127.         #else
  128.             #define TYPE_LONGLONG        0
  129.         #endif
  130.         #if __option(bool)
  131.             #define TYPE_BOOL            1
  132.         #else
  133.             #define TYPE_BOOL            0
  134.         #endif
  135.     #else
  136.         #define TYPE_LONGLONG            0
  137.         #define TYPE_BOOL                0
  138.     #endif
  139.     #define TYPE_EXTENDED                0
  140.     
  141.  
  142.  
  143. #elif defined(__SC__) && (defined(MPW_CPLUS) || defined(MPW_C))
  144.     /*
  145.         SC[pp] compiler from Apple Computer, Inc.
  146.     */
  147.     #define TARGET_CPU_PPC              0
  148.     #define TARGET_CPU_68K              1
  149.     #define TARGET_CPU_X86              0
  150.     #define TARGET_CPU_MIPS             0
  151.     #define TARGET_CPU_SPARC            0        
  152.     #define TARGET_CPU_ALPHA            0
  153.     #define TARGET_OS_MAC                1
  154.     #define TARGET_OS_WIN32                0
  155.     #define TARGET_OS_UNIX                0
  156.     #define TARGET_RT_LITTLE_ENDIAN        0
  157.     #define TARGET_RT_BIG_ENDIAN        1
  158.     #if defined(__CFM68K__)
  159.         #define TARGET_RT_MAC_CFM        1
  160.     #else
  161.         #define TARGET_RT_MAC_CFM        0
  162.     #endif
  163.     #if defined(mc68881)
  164.         #define TARGET_RT_MAC_68881        1
  165.     #else
  166.         #define TARGET_RT_MAC_68881        0
  167.     #endif
  168.     #if TARGET_RT_MAC_CFM 
  169.         #define PRAGMA_IMPORT            1
  170.         #if (__SC__ <= 0x0810)
  171.             /* old versions of SC don't support “#pragma import reset” */
  172.             #define PRAGMA_IMPORT_OFF    1
  173.         #endif
  174.     #else
  175.         #define PRAGMA_IMPORT            0
  176.     #endif
  177.     #define PRAGMA_STRUCT_ALIGN            0
  178.     #define PRAGMA_ONCE                    0
  179.     #define PRAGMA_STRUCT_PACK            0
  180.     #define PRAGMA_STRUCT_PACKPUSH        0
  181.     #define PRAGMA_ENUM_PACK            1
  182.     #define PRAGMA_ENUM_ALWAYSINT        0
  183.     #define PRAGMA_ENUM_OPTIONS            0
  184.     #define FOUR_CHAR_CODE(x)            (x)
  185.     
  186.     #define TYPE_LONGLONG                0
  187.     #define TYPE_EXTENDED                1
  188.     #if (__SC__  > 0x0810)
  189.         #if __option(bool)
  190.             #define TYPE_BOOL            1
  191.         #else
  192.             #define TYPE_BOOL            0
  193.         #endif
  194.     #else
  195.         #define TYPE_BOOL                0
  196.     #endif
  197.         
  198.  
  199.  
  200. #elif defined(__MWERKS__)
  201.     /*
  202.         CodeWarrior compiler from Metrowerks, Inc.
  203.     */
  204.     #if (__MWERKS__ < 0x0900) || macintosh
  205.         #define TARGET_OS_MAC                1
  206.         #define TARGET_OS_WIN32                0
  207.         #define TARGET_OS_UNIX                0
  208.         #define TARGET_CPU_X86              0
  209.         #define TARGET_CPU_MIPS             0
  210.         #define TARGET_CPU_SPARC            0        
  211.         #define TARGET_CPU_ALPHA            0
  212.         #define TARGET_RT_LITTLE_ENDIAN        0
  213.         #define TARGET_RT_BIG_ENDIAN        1
  214.         #if powerc
  215.             #define TARGET_CPU_PPC          1
  216.             #define TARGET_CPU_68K          0
  217.             #define TARGET_RT_MAC_CFM        1
  218.             #define TARGET_RT_MAC_68881        0
  219.         #else
  220.             #define TARGET_CPU_PPC          0
  221.             #define TARGET_CPU_68K          1
  222.             #if defined(__CFM68K__)
  223.                 #define TARGET_RT_MAC_CFM    1
  224.             #else
  225.                 #define TARGET_RT_MAC_CFM    0
  226.             #endif
  227.             #if __MC68881__
  228.                 #define TARGET_RT_MAC_68881    1
  229.             #else
  230.                 #define TARGET_RT_MAC_68881    0
  231.             #endif
  232.         #endif
  233.         #define PRAGMA_ONCE                    1
  234.         #if (__MWERKS__ >= 0x0700)
  235.             #define PRAGMA_IMPORT            TARGET_RT_MAC_CFM
  236.         #else
  237.             #define PRAGMA_IMPORT            0
  238.         #endif
  239.         #define PRAGMA_STRUCT_ALIGN            1
  240.         #define PRAGMA_STRUCT_PACK            0
  241.         #define PRAGMA_STRUCT_PACKPUSH        0
  242.         #define PRAGMA_ENUM_PACK            0
  243.         #define PRAGMA_ENUM_ALWAYSINT        1
  244.         #define PRAGMA_ENUM_OPTIONS            0
  245.         #define FOUR_CHAR_CODE(x)            (x)
  246.  
  247.     
  248.     #elif (__MWERKS__ >= 0x0900) && __INTEL__
  249.         #define TARGET_CPU_PPC              0
  250.         #define TARGET_CPU_68K              0
  251.         #define TARGET_CPU_X86              1
  252.         #define TARGET_CPU_MIPS             0
  253.         #define TARGET_CPU_SPARC            0        
  254.         #define TARGET_CPU_ALPHA            0
  255.         #define TARGET_OS_MAC                0
  256.         #define TARGET_OS_WIN32                1
  257.         #define TARGET_OS_UNIX                0
  258.         #define TARGET_RT_LITTLE_ENDIAN        1
  259.         #define TARGET_RT_BIG_ENDIAN        0
  260.         #define TARGET_RT_MAC_CFM            0
  261.         #define TARGET_RT_MAC_68881            0
  262.         #define PRAGMA_ONCE                    1
  263.         #define PRAGMA_IMPORT                0
  264.         #define PRAGMA_STRUCT_ALIGN            0
  265.         #define PRAGMA_STRUCT_PACK            1
  266.         #define PRAGMA_STRUCT_PACKPUSH        1
  267.         #define PRAGMA_ENUM_PACK            0
  268.         #define PRAGMA_ENUM_ALWAYSINT        1
  269.         #define PRAGMA_ENUM_OPTIONS            0
  270.         #define FOUR_CHAR_CODE(x)            (x)
  271.  
  272.  
  273.     #elif (__MWERKS__ >= 0x1900) && __MIPS__
  274.         #define TARGET_CPU_PPC              0
  275.         #define TARGET_CPU_68K              0
  276.         #define TARGET_CPU_X86              0
  277.         #define TARGET_CPU_MIPS             1
  278.         #define TARGET_CPU_SPARC            0        
  279.         #define TARGET_CPU_ALPHA            0
  280.         #define TARGET_OS_MAC                0
  281.         #define TARGET_OS_WIN32                0
  282.         #define TARGET_OS_UNIX                1
  283.         #if __option(little_endian)
  284.             #define TARGET_RT_LITTLE_ENDIAN    1
  285.             #define TARGET_RT_BIG_ENDIAN    0
  286.         #else
  287.             #define TARGET_RT_LITTLE_ENDIAN    0
  288.             #define TARGET_RT_BIG_ENDIAN    1
  289.         #endif
  290.         #define TARGET_RT_MAC_CFM            0
  291.         #define TARGET_RT_MAC_68881            0
  292.         #define PRAGMA_ONCE                    1
  293.         #define PRAGMA_IMPORT                0
  294.         #define PRAGMA_STRUCT_ALIGN            0
  295.         #define PRAGMA_STRUCT_PACK            1
  296.         #define PRAGMA_STRUCT_PACKPUSH        0
  297.         #define PRAGMA_ENUM_PACK            0
  298.         #define PRAGMA_ENUM_ALWAYSINT        1
  299.         #define PRAGMA_ENUM_OPTIONS            0
  300.         #define FOUR_CHAR_CODE(x)            (x)
  301.     
  302.     #else    
  303.         #error unknown Metrowerks compiler
  304.     #endif
  305.  
  306.  
  307.     #if (__MWERKS__ >= 0x1100)
  308.         #if __option(longlong)
  309.             #define TYPE_LONGLONG        1
  310.             #define _LONG_LONG            1        /* temporary */
  311.         #else
  312.             #define TYPE_LONGLONG        0
  313.         #endif
  314.     #else
  315.         #define TYPE_LONGLONG            0
  316.     #endif
  317.     #if (__MWERKS__ >= 0x1000)
  318.         #if __option(bool)
  319.             #define TYPE_BOOL            1
  320.         #else
  321.             #define TYPE_BOOL            0
  322.         #endif
  323.     #else
  324.         #define TYPE_BOOL                0
  325.     #endif
  326.  
  327.     #if TARGET_OS_MAC && TARGET_CPU_68K
  328.         typedef long double extended;
  329.         #define TYPE_EXTENDED            1
  330.     #else
  331.         #define TYPE_EXTENDED            0
  332.     #endif
  333.  
  334.  
  335.  
  336. #elif defined(SYMANTEC_CPLUS) || defined(SYMANTEC_C)
  337.     /*
  338.         C and C++ compiler from Symantec, Inc.
  339.     */
  340.     #define TARGET_OS_MAC                1
  341.     #define TARGET_OS_WIN32                0
  342.     #define TARGET_OS_UNIX                0
  343.     #define TARGET_CPU_X86              0
  344.     #define TARGET_CPU_MIPS             0
  345.     #define TARGET_CPU_SPARC            0        
  346.     #define TARGET_CPU_ALPHA            0
  347.     #define TARGET_RT_LITTLE_ENDIAN        0
  348.     #define TARGET_RT_BIG_ENDIAN        1
  349.     #if powerc
  350.         #define TARGET_CPU_PPC          1
  351.         #define TARGET_CPU_68K          0
  352.         #define TARGET_RT_MAC_CFM        1
  353.         #define TARGET_RT_MAC_68881        0
  354.     #else
  355.         #define TARGET_CPU_PPC          0
  356.         #define TARGET_CPU_68K          1
  357.         #if defined(__CFM68K)
  358.             #define TARGET_RT_MAC_CFM    1
  359.         #else
  360.             #define TARGET_RT_MAC_CFM    0
  361.         #endif
  362.         #if mc68881
  363.             #define TARGET_RT_MAC_68881    1
  364.         #else
  365.             #define TARGET_RT_MAC_68881    0
  366.         #endif
  367.     #endif
  368.     #define PRAGMA_IMPORT                0
  369.     #define PRAGMA_ONCE                    1
  370.     #define PRAGMA_STRUCT_ALIGN            1
  371.     #define PRAGMA_STRUCT_PACK            0
  372.     #define PRAGMA_STRUCT_PACKPUSH        0
  373.     #define PRAGMA_ENUM_PACK            1
  374.     #define PRAGMA_ENUM_ALWAYSINT        0
  375.     #define PRAGMA_ENUM_OPTIONS            0
  376.     #define FOUR_CHAR_CODE(x)            (x)
  377.     
  378.     #if __useAppleExts__
  379.         #define TYPE_EXTENDED            1
  380.     #else
  381.         #define TYPE_EXTENDED            0
  382.     #endif
  383.     #define TYPE_LONGLONG                0
  384.     #define TYPE_BOOL                    0
  385.     
  386.  
  387.  
  388. #elif defined(THINK_C)
  389.     /*
  390.         THINK C compiler from Symantec, Inc.        << WARNING: Unsupported Compiler >>
  391.     */
  392.     #define TARGET_CPU_PPC              0
  393.     #define TARGET_CPU_68K              1
  394.     #define TARGET_CPU_X86              0
  395.     #define TARGET_CPU_MIPS             0
  396.     #define TARGET_CPU_SPARC            0        
  397.     #define TARGET_CPU_ALPHA            0
  398.     #define TARGET_OS_MAC                1
  399.     #define TARGET_OS_WIN32                0
  400.     #define TARGET_OS_UNIX                0
  401.     #define TARGET_RT_LITTLE_ENDIAN        0
  402.     #define TARGET_RT_BIG_ENDIAN        1
  403.     #define TARGET_RT_MAC_CFM            0
  404.     #if defined(mc68881)
  405.         #define TARGET_RT_MAC_68881        1
  406.     #else
  407.         #define TARGET_RT_MAC_68881        0
  408.     #endif
  409.     #define PRAGMA_IMPORT                0
  410.     #define PRAGMA_STRUCT_ALIGN            0
  411.     #define PRAGMA_ONCE                    1
  412.     #define PRAGMA_STRUCT_PACK            0
  413.     #define PRAGMA_STRUCT_PACKPUSH        0
  414.     #define PRAGMA_ENUM_PACK            1
  415.     #define PRAGMA_ENUM_ALWAYSINT        0
  416.     #define PRAGMA_ENUM_OPTIONS            0
  417.     #define FOUR_CHAR_CODE(x)            (x)
  418.     
  419.     #define TYPE_EXTENDED                1
  420.     #define TYPE_LONGLONG                0
  421.     #define TYPE_BOOL                    0
  422.     
  423.  
  424.  
  425. #elif defined(__PPCC__)
  426.     /*
  427.         PPCC compiler from Apple Computer, Inc.        << WARNING: Unsupported Compiler >>
  428.     */
  429.     #define TARGET_CPU_PPC              1
  430.     #define TARGET_CPU_68K              0
  431.     #define TARGET_CPU_X86              0
  432.     #define TARGET_CPU_MIPS             0
  433.     #define TARGET_CPU_SPARC            0        
  434.     #define TARGET_CPU_ALPHA            0
  435.     #define TARGET_OS_MAC                1
  436.     #define TARGET_OS_WIN32                0
  437.     #define TARGET_OS_UNIX                0
  438.     #define TARGET_RT_LITTLE_ENDIAN        0
  439.     #define TARGET_RT_BIG_ENDIAN        1
  440.     #define TARGET_RT_MAC_CFM            1
  441.     #define TARGET_RT_MAC_68881            0
  442.     #define PRAGMA_IMPORT                0
  443.     #define PRAGMA_STRUCT_ALIGN            1
  444.     #define PRAGMA_ONCE                    0
  445.     #define PRAGMA_STRUCT_PACK            0
  446.     #define PRAGMA_STRUCT_PACKPUSH        0
  447.     #define PRAGMA_ENUM_PACK            0
  448.     #define PRAGMA_ENUM_ALWAYSINT        0
  449.     #define PRAGMA_ENUM_OPTIONS            0
  450.     #define FOUR_CHAR_CODE(x)            (x)
  451.     
  452.     #define TYPE_EXTENDED                0
  453.     #define TYPE_LONGLONG                0
  454.     #define TYPE_BOOL                    0
  455.  
  456.  
  457. #elif defined(applec) && !defined(__SC__)
  458.     /*
  459.         MPW C compiler from Apple Computer, Inc.    << WARNING: Unsupported Compiler >>
  460.     */
  461.     #define TARGET_CPU_PPC              0
  462.     #define TARGET_CPU_68K              1
  463.     #define TARGET_CPU_X86              0
  464.     #define TARGET_CPU_MIPS             0
  465.     #define TARGET_CPU_SPARC            0        
  466.     #define TARGET_CPU_ALPHA            0
  467.     #define TARGET_OS_MAC                1
  468.     #define TARGET_OS_WIN32                0
  469.     #define TARGET_OS_UNIX                0
  470.     #define TARGET_RT_LITTLE_ENDIAN        0
  471.     #define TARGET_RT_BIG_ENDIAN        1
  472.     #define TARGET_RT_MAC_CFM            0
  473.     #if defined(mc68881)
  474.         #define TARGET_RT_MAC_68881        1
  475.     #else
  476.         #define TARGET_RT_MAC_68881        0
  477.     #endif
  478.     #define PRAGMA_IMPORT                0
  479.     #define PRAGMA_STRUCT_ALIGN            0
  480.     #define PRAGMA_ONCE                    0
  481.     #define PRAGMA_STRUCT_PACK            0
  482.     #define PRAGMA_STRUCT_PACKPUSH        0
  483.     #define PRAGMA_ENUM_PACK            0
  484.     #define PRAGMA_ENUM_ALWAYSINT        0
  485.     #define PRAGMA_ENUM_OPTIONS            0
  486.     /* Note: MPW C 3.2 had a bug where MACRO('xx   ') would cause 'xx  ' to be misevaluated */
  487.     #define FOUR_CHAR_CODE                
  488.  
  489.     #define TYPE_EXTENDED                1
  490.     #define TYPE_LONGLONG                0
  491.     #define TYPE_BOOL                    0
  492.  
  493.  
  494.  
  495. #elif defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__NEXT_CPP__))
  496.     /*
  497.         gcc from Next, Inc., with cpp-precomp (header precompiler)
  498.     */
  499.     #if defined(powerpc) || defined(ppc)
  500.         #define TARGET_CPU_PPC            1
  501.         #define TARGET_CPU_68K            0
  502.         #define TARGET_CPU_X86            0
  503.         #define TARGET_CPU_MIPS            0
  504.         #define TARGET_CPU_SPARC        0   
  505.         #define TARGET_CPU_ALPHA        0
  506.         #define TARGET_RT_MAC_CFM        0
  507.         #define TARGET_RT_MAC_68881        0
  508.         #define TARGET_RT_LITTLE_ENDIAN    0
  509.         #define TARGET_RT_BIG_ENDIAN    1
  510.     #elif defined(m68k)
  511.         #define TARGET_CPU_PPC            0
  512.         #define TARGET_CPU_68K            1
  513.         #define TARGET_CPU_X86            0
  514.         #define TARGET_CPU_MIPS            0
  515.         #define TARGET_CPU_SPARC        0   
  516.         #define TARGET_CPU_ALPHA        0
  517.         #define TARGET_RT_MAC_CFM        0
  518.         #define TARGET_RT_MAC_68881        0
  519.         #define TARGET_RT_LITTLE_ENDIAN 0
  520.         #define TARGET_RT_BIG_ENDIAN    1
  521.     #elif defined(sparc)
  522.         #define TARGET_CPU_PPC            0
  523.         #define TARGET_CPU_68K            0
  524.         #define TARGET_CPU_X86            0
  525.         #define TARGET_CPU_MIPS            0
  526.         #define TARGET_CPU_SPARC        1
  527.         #define TARGET_CPU_ALPHA        0
  528.         #define TARGET_RT_MAC_CFM        0
  529.         #define TARGET_RT_MAC_68881        0
  530.         #define TARGET_RT_LITTLE_ENDIAN    0
  531.         #define TARGET_RT_BIG_ENDIAN    1
  532.     #elif defined(i386) || defined(intel)
  533.         #define TARGET_CPU_PPC            0
  534.         #define TARGET_CPU_68K            0
  535.         #define TARGET_CPU_X86            1
  536.         #define TARGET_CPU_MIPS            0
  537.         #define TARGET_CPU_SPARC        0
  538.         #define TARGET_CPU_ALPHA        0
  539.         #define TARGET_RT_MAC_CFM        0
  540.         #define TARGET_RT_MAC_68881        0
  541.         #define TARGET_RT_LITTLE_ENDIAN    1
  542.         #define TARGET_RT_BIG_ENDIAN    0
  543.     #else
  544.         #error unrecognized NeXT GNU C compiler
  545.     #endif
  546.  
  547.  
  548.     #define TARGET_OS_MAC                0
  549.     #define TARGET_OS_WIN32                0
  550.     #define TARGET_OS_UNIX                1
  551.     #define PRAGMA_IMPORT                0
  552.     #define PRAGMA_STRUCT_ALIGN            1
  553.     #define PRAGMA_ONCE                    0
  554.     #define PRAGMA_STRUCT_PACK            0
  555.     #define PRAGMA_STRUCT_PACKPUSH        0
  556.     #define PRAGMA_ENUM_PACK            0
  557.     #define PRAGMA_ENUM_ALWAYSINT        0
  558.     #define PRAGMA_ENUM_OPTIONS            0
  559.     #define FOUR_CHAR_CODE(x)            (x)
  560.  
  561.     #define TYPE_EXTENDED                0
  562.     #ifdef _LONG_LONG
  563.         #define TYPE_LONGLONG            1
  564.     #else
  565.         #define TYPE_LONGLONG            0
  566.     #endif
  567.     #define TYPE_BOOL                    0
  568.  
  569.  
  570. #elif defined(__GNUC__)
  571.     /*
  572.         gC for MPW from Free Software Foundation, Inc.
  573.     */
  574.     #if #cpu(powerpc)
  575.         #define TARGET_CPU_PPC          1
  576.         #define TARGET_CPU_68K          0
  577.         #define TARGET_CPU_X86          0
  578.         #define TARGET_CPU_MIPS         0
  579.         #define TARGET_CPU_SPARC        0    
  580.         #define TARGET_CPU_ALPHA        0
  581.         #define TARGET_RT_MAC_CFM        1
  582.         #define TARGET_RT_MAC_68881        0
  583.     #elif #cpu(m68k)
  584.         #define TARGET_CPU_PPC          0
  585.         #define TARGET_CPU_68K          1
  586.         #define TARGET_CPU_X86          0
  587.         #define TARGET_CPU_MIPS         0
  588.         #define TARGET_CPU_SPARC        0    
  589.         #define TARGET_CPU_ALPHA        0
  590.         #define TARGET_RT_MAC_CFM        0
  591.         #define TARGET_RT_MAC_68881        0
  592.     #else
  593.         #error unsupported GNU C compiler
  594.     #endif
  595.     
  596.     #if #system(macos)
  597.         #define TARGET_OS_MAC            1
  598.         #define TARGET_OS_WIN32            0
  599.         #define TARGET_OS_UNIX            0
  600.     #elif #system(unix)
  601.         #define TARGET_OS_MAC            0
  602.         #define TARGET_OS_WIN32            0
  603.         #define TARGET_OS_UNIX            1
  604.     #else
  605.         #error unsupported GNU C compiler
  606.     #endif
  607.     
  608.     #define TARGET_RT_LITTLE_ENDIAN        0
  609.     #define TARGET_RT_BIG_ENDIAN        1
  610.     #define PRAGMA_IMPORT                0
  611.     #define PRAGMA_STRUCT_ALIGN            1
  612.     #define PRAGMA_ONCE                    0
  613.     #define PRAGMA_STRUCT_PACK            0
  614.     #define PRAGMA_STRUCT_PACKPUSH        0
  615.     #define PRAGMA_ENUM_PACK            0
  616.     #define PRAGMA_ENUM_ALWAYSINT        0
  617.     #define PRAGMA_ENUM_OPTIONS            0
  618.     #define FOUR_CHAR_CODE(x)            (x)
  619.  
  620.     #define TYPE_EXTENDED                0
  621.     #ifdef _LONG_LONG
  622.         #define TYPE_LONGLONG            1
  623.     #else
  624.         #define TYPE_LONGLONG            0
  625.     #endif
  626.     #define TYPE_BOOL                    0
  627.  
  628.  
  629.  
  630. #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  631.     /*
  632.         xlc and xlC on RS/6000 from IBM, Inc.
  633.     */
  634.     #define TARGET_CPU_PPC              1
  635.     #define TARGET_CPU_68K              0
  636.     #define TARGET_CPU_X86              0
  637.     #define TARGET_CPU_MIPS             0
  638.     #define TARGET_CPU_SPARC            0        
  639.     #define TARGET_CPU_ALPHA            0
  640.     #if defined(_AIX)
  641.         #define TARGET_OS_MAC            0
  642.         #define TARGET_OS_UNIX            1
  643.     #else
  644.         #define TARGET_OS_MAC            1
  645.         #define TARGET_OS_UNIX            0
  646.     #endif
  647.     #define TARGET_OS_WIN32                0
  648.     #define TARGET_RT_LITTLE_ENDIAN        0
  649.     #define TARGET_RT_BIG_ENDIAN        1
  650.     #define TARGET_RT_MAC_CFM            1
  651.     #define TARGET_RT_MAC_68881            0
  652.     #define PRAGMA_IMPORT                0
  653.     #define PRAGMA_STRUCT_ALIGN            1
  654.     #define PRAGMA_ONCE                    0
  655.     #define PRAGMA_STRUCT_PACK            0
  656.     #define PRAGMA_STRUCT_PACKPUSH        0
  657.     #define PRAGMA_ENUM_PACK            0
  658.     #define PRAGMA_ENUM_ALWAYSINT        0
  659.     #define PRAGMA_ENUM_OPTIONS            1
  660.     #define FOUR_CHAR_CODE(x)            (x)
  661.  
  662.     #define TYPE_EXTENDED                0
  663.     #ifdef _LONG_LONG
  664.         #define TYPE_LONGLONG            1
  665.     #else
  666.         #define TYPE_LONGLONG            0
  667.     #endif
  668.     #define TYPE_BOOL                    0
  669.  
  670.  
  671. #elif defined(_MSC_VER) && !defined(__MWERKS__) 
  672.     /*
  673.         Visual C++ from Microsoft, Inc.
  674.     */
  675.     #if defined(_M_M68K)    /* Visual C++ with Macintosh 68K target */
  676.         #define TARGET_CPU_PPC              0
  677.         #define TARGET_CPU_68K              1
  678.         #define TARGET_CPU_X86              0
  679.         #define TARGET_CPU_MIPS             0
  680.         #define TARGET_CPU_SPARC            0
  681.         #define TARGET_CPU_ALPHA            0
  682.         #define TARGET_OS_MAC                1
  683.         #define TARGET_OS_WIN32                0
  684.         #define TARGET_OS_UNIX                0
  685.         #define TARGET_RT_LITTLE_ENDIAN        0
  686.         #define TARGET_RT_BIG_ENDIAN        1
  687.         #define TARGET_RT_MAC_CFM            0
  688.         #define TARGET_RT_MAC_68881            0
  689.         #define PRAGMA_IMPORT                0
  690.         #define PRAGMA_STRUCT_ALIGN            1
  691.         #define PRAGMA_ONCE                     0
  692.         #define PRAGMA_STRUCT_PACK            1
  693.         #define PRAGMA_STRUCT_PACKPUSH        1
  694.         #define PRAGMA_ENUM_PACK            0
  695.         #define PRAGMA_ENUM_ALWAYSINT        0
  696.         #define PRAGMA_ENUM_OPTIONS            0
  697.         #define FOUR_CHAR_CODE(x)            (x)
  698.         #define TYPE_EXTENDED                0
  699.         #define TYPE_LONGLONG                0
  700.         #define TYPE_BOOL                    0
  701.     #elif defined(_M_MPPC)    /* Visual C++ with Macintosh PowerPC target */
  702.         #define TARGET_CPU_PPC              1
  703.         #define TARGET_CPU_68K              0
  704.         #define TARGET_CPU_X86              0
  705.         #define TARGET_CPU_MIPS             0
  706.         #define TARGET_CPU_SPARC            0
  707.         #define TARGET_CPU_ALPHA            0
  708.         #define TARGET_OS_MAC                1
  709.         #define TARGET_OS_WIN32                0
  710.         #define TARGET_OS_UNIX                0
  711.         #define TARGET_RT_LITTLE_ENDIAN        0
  712.         #define TARGET_RT_BIG_ENDIAN        1
  713.         #define TARGET_RT_MAC_CFM            1
  714.         #define TARGET_RT_MAC_68881            0
  715.         #define PRAGMA_IMPORT                0
  716.         #define PRAGMA_STRUCT_ALIGN            1
  717.         #define PRAGMA_ONCE                     0
  718.         #define PRAGMA_STRUCT_PACK            1
  719.         #define PRAGMA_STRUCT_PACKPUSH        1
  720.         #define PRAGMA_ENUM_PACK            0
  721.         #define PRAGMA_ENUM_ALWAYSINT        0
  722.         #define PRAGMA_ENUM_OPTIONS            0
  723.         #define FOUR_CHAR_CODE(x)            (x)
  724.         #define TYPE_EXTENDED                0
  725.         #define TYPE_LONGLONG                0
  726.         #define TYPE_BOOL                    0
  727.  
  728.     #elif defined(_M_IX86)    /* Visual C++ with Intel x86 target */
  729.         #define TARGET_CPU_PPC              0
  730.         #define TARGET_CPU_68K              0
  731.         #define TARGET_CPU_X86              1
  732.         #define TARGET_CPU_MIPS             0
  733.         #define TARGET_CPU_SPARC            0
  734.         #define TARGET_CPU_ALPHA            0
  735.         #define TARGET_OS_MAC                0
  736.         #define TARGET_OS_WIN32                1
  737.         #define TARGET_OS_UNIX                0
  738.         #define TARGET_RT_LITTLE_ENDIAN        1
  739.         #define TARGET_RT_BIG_ENDIAN        0
  740.         #define TARGET_RT_MAC_CFM            0
  741.         #define TARGET_RT_MAC_68881            0
  742.         #define PRAGMA_IMPORT                0
  743.         #define PRAGMA_STRUCT_ALIGN            0
  744.         #define PRAGMA_ONCE                     0
  745.         #define PRAGMA_STRUCT_PACK            1
  746.         #define PRAGMA_STRUCT_PACKPUSH        1
  747.         #define PRAGMA_ENUM_PACK            0
  748.         #define PRAGMA_ENUM_ALWAYSINT        0
  749.         #define PRAGMA_ENUM_OPTIONS            0
  750.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  751.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  752.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  753.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  754.         #define TYPE_EXTENDED                0
  755.         #define TYPE_LONGLONG                0
  756.         #if defined(__cplusplus) && (_MSC_VER >= 1100)
  757.             #define TYPE_BOOL                1
  758.         #else
  759.             #define TYPE_BOOL                0
  760.         #endif
  761.  
  762.         #elif defined(_M_ALPHA)        /* Visual C++ with Dec Alpha target */
  763.         #define TARGET_CPU_PPC              0
  764.         #define TARGET_CPU_68K              0
  765.         #define TARGET_CPU_X86              0
  766.         #define TARGET_CPU_MIPS             0
  767.         #define TARGET_CPU_SPARC            0
  768.         #define TARGET_CPU_ALPHA            1
  769.         #define TARGET_OS_MAC                0
  770.         #define TARGET_OS_WIN32                1
  771.         #define TARGET_OS_UNIX                0
  772.         #define TARGET_RT_LITTLE_ENDIAN        1
  773.         #define TARGET_RT_BIG_ENDIAN        0
  774.         #define TARGET_RT_MAC_CFM            0
  775.         #define TARGET_RT_MAC_68881            0
  776.         #define PRAGMA_IMPORT                0
  777.         #define PRAGMA_STRUCT_ALIGN            0
  778.         #define PRAGMA_ONCE                     0
  779.         #define PRAGMA_STRUCT_PACK            1
  780.         #define PRAGMA_STRUCT_PACKPUSH        1
  781.         #define PRAGMA_ENUM_PACK            0
  782.         #define PRAGMA_ENUM_ALWAYSINT        0
  783.         #define PRAGMA_ENUM_OPTIONS            0
  784.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  785.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  786.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  787.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  788.         #define TYPE_EXTENDED                0
  789.         #define TYPE_LONGLONG                0
  790.         #define TYPE_BOOL                    0
  791.  
  792.     #elif defined(_M_PPC)    /* Visual C++ for Windows NT on PowerPC target */
  793.         #define TARGET_CPU_PPC              1
  794.         #define TARGET_CPU_68K              0
  795.         #define TARGET_CPU_X86              0
  796.         #define TARGET_CPU_MIPS             0
  797.         #define TARGET_CPU_SPARC            0
  798.         #define TARGET_CPU_ALPHA            0
  799.         #define TARGET_OS_MAC                0
  800.         #define TARGET_OS_WIN32                1
  801.         #define TARGET_OS_UNIX                0
  802.         #define TARGET_RT_LITTLE_ENDIAN        1
  803.         #define TARGET_RT_BIG_ENDIAN        0
  804.         #define TARGET_RT_MAC_CFM            0
  805.         #define TARGET_RT_MAC_68881            0
  806.         #define PRAGMA_IMPORT                0
  807.         #define PRAGMA_STRUCT_ALIGN            0
  808.         #define PRAGMA_ONCE                     0
  809.         #define PRAGMA_STRUCT_PACK            1
  810.         #define PRAGMA_STRUCT_PACKPUSH        1
  811.         #define PRAGMA_ENUM_PACK            0
  812.         #define PRAGMA_ENUM_ALWAYSINT        0
  813.         #define PRAGMA_ENUM_OPTIONS            0
  814.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  815.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  816.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  817.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  818.         #define TYPE_EXTENDED                0
  819.         #define TYPE_LONGLONG                0
  820.         #define TYPE_BOOL                    0
  821.  
  822.         #elif defined(_M_MRX000)    /* Visual C++ for Windows NT on MIPS target */
  823.         #define TARGET_CPU_PPC              0
  824.         #define TARGET_CPU_68K              0
  825.         #define TARGET_CPU_X86              0
  826.         #define TARGET_CPU_MIPS             1
  827.         #define TARGET_CPU_SPARC            0
  828.         #define TARGET_CPU_ALPHA            0
  829.         #define TARGET_OS_MAC                0
  830.         #define TARGET_OS_WIN32                1
  831.         #define TARGET_OS_UNIX                0
  832.         #define TARGET_RT_LITTLE_ENDIAN        1
  833.         #define TARGET_RT_BIG_ENDIAN        0
  834.         #define TARGET_RT_MAC_CFM            0
  835.         #define TARGET_RT_MAC_68881            0
  836.         #define PRAGMA_IMPORT                0
  837.         #define PRAGMA_STRUCT_ALIGN            0
  838.         #define PRAGMA_ONCE                     0
  839.         #define PRAGMA_STRUCT_PACK            1
  840.         #define PRAGMA_STRUCT_PACKPUSH        1
  841.         #define PRAGMA_ENUM_PACK            0
  842.         #define PRAGMA_ENUM_ALWAYSINT        0
  843.         #define PRAGMA_ENUM_OPTIONS            0
  844.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  845.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  846.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  847.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  848.         #define TYPE_EXTENDED                0
  849.         #define TYPE_LONGLONG                0
  850.         #define TYPE_BOOL                    0
  851.     #endif
  852.  
  853.  
  854. #elif defined(__MOTO__)
  855.     /*
  856.         mcc from Motorola, Inc. 
  857.     */
  858.     #define TARGET_CPU_PPC              1
  859.     #define TARGET_CPU_68K              0
  860.     #define TARGET_CPU_X86              0
  861.     #define TARGET_CPU_MIPS             0
  862.     #define TARGET_CPU_SPARC            0        
  863.     #define TARGET_CPU_ALPHA            0
  864.     #define TARGET_OS_MAC                1
  865.     #define TARGET_OS_WIN32                0
  866.     #define TARGET_OS_UNIX                0
  867.     #define TARGET_RT_LITTLE_ENDIAN        0
  868.     #define TARGET_RT_BIG_ENDIAN        1
  869.     #define TARGET_RT_MAC_CFM            1
  870.     #define TARGET_RT_MAC_68881            0
  871.     #define PRAGMA_IMPORT                0            /* how is this detected ?? */
  872.     #define PRAGMA_STRUCT_ALIGN            1
  873.     #if __MOTO__ >= 40702                             /* MCC version 4.7.2 */
  874.       #define PRAGMA_ONCE                 1
  875.     #else
  876.       #define PRAGMA_ONCE                 0
  877.     #endif
  878.     #define PRAGMA_STRUCT_PACK            0
  879.     #define PRAGMA_STRUCT_PACKPUSH        0
  880.     #define PRAGMA_ENUM_PACK            0
  881.     #define PRAGMA_ENUM_ALWAYSINT        0
  882.     #define PRAGMA_ENUM_OPTIONS            0
  883.     #define FOUR_CHAR_CODE(x)            (x)
  884.     #define TYPE_LONGLONG                0            /* how is this detected ?? */
  885.     #ifdef _BOOL
  886.         #define TYPE_BOOL                1            
  887.     #else
  888.         #define TYPE_BOOL                0            
  889.     #endif
  890.     #define TYPE_EXTENDED                0
  891.  
  892.  
  893.  
  894. #elif defined(_MIPS_ISA)
  895.     /*
  896.         MIPSpro compiler from Silicon Graphics Inc.
  897.     */
  898.     #define TARGET_CPU_PPC              0
  899.     #define TARGET_CPU_68K              0
  900.     #define TARGET_CPU_X86              0
  901.     #define TARGET_CPU_MIPS             1
  902.     #define TARGET_CPU_SPARC            0        
  903.     #define TARGET_CPU_ALPHA            0
  904.     #define TARGET_OS_MAC                0
  905.     #define TARGET_OS_WIN32                0
  906.     #define TARGET_OS_UNIX                1
  907.     #define TARGET_RT_LITTLE_ENDIAN        0
  908.     #define TARGET_RT_BIG_ENDIAN        1
  909.     #define TARGET_RT_MAC_CFM            0
  910.     #define TARGET_RT_MAC_68881            0
  911.     #define PRAGMA_IMPORT                0
  912.     #define PRAGMA_STRUCT_ALIGN            0
  913.     #define PRAGMA_ONCE                    0
  914.     #define PRAGMA_STRUCT_PACK            1
  915.     #define PRAGMA_STRUCT_PACKPUSH        0
  916.     #define PRAGMA_ENUM_PACK            0
  917.     #define PRAGMA_ENUM_ALWAYSINT        0
  918.     #define PRAGMA_ENUM_OPTIONS            0
  919.     #define FOUR_CHAR_CODE(x)            (x)
  920.     #define TYPE_EXTENDED                0
  921.     #define TYPE_LONGLONG                0
  922.     #define TYPE_BOOL                    0
  923.  
  924.  
  925. #elif defined(__sparc)
  926.     /*
  927.         SPARCompiler compiler from Sun Microsystems Inc.
  928.     */
  929.     #define TARGET_CPU_PPC              0
  930.     #define TARGET_CPU_68K              0
  931.     #define TARGET_CPU_X86              0
  932.     #define TARGET_CPU_MIPS             0
  933.     #define TARGET_CPU_SPARC            1        
  934.     #define TARGET_CPU_ALPHA            0
  935.     #define TARGET_OS_MAC                0
  936.     #define TARGET_OS_WIN32                0
  937.     #define TARGET_OS_UNIX                1
  938.     #define TARGET_RT_LITTLE_ENDIAN        0
  939.     #define TARGET_RT_BIG_ENDIAN        1
  940.     #define TARGET_RT_MAC_CFM            0
  941.     #define TARGET_RT_MAC_68881            0
  942.     #define PRAGMA_IMPORT                0
  943.     #define PRAGMA_STRUCT_ALIGN            0
  944.     #define PRAGMA_ONCE                    0
  945.     #define PRAGMA_STRUCT_PACK            1
  946.     #define PRAGMA_STRUCT_PACKPUSH        0
  947.     #define PRAGMA_ENUM_PACK            0
  948.     #define PRAGMA_ENUM_ALWAYSINT        0
  949.     #define PRAGMA_ENUM_OPTIONS            0
  950.     #define FOUR_CHAR_CODE(x)        (((unsigned long) ((x) & 0x000000FF)) << 24) \
  951.                                     | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  952.                                     | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  953.                                     | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  954.     #define TYPE_EXTENDED                0
  955.     #define TYPE_LONGLONG                0
  956.     #define TYPE_BOOL                    0
  957.  
  958.  
  959. #else
  960.     /*
  961.         Unknown compiler, perhaps set up from the command line (e.g. -d TARGET_CPU_MIPS , etc.)
  962.     */
  963.     #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
  964.         #define TARGET_CPU_68K   0
  965.         #define TARGET_CPU_X86   0
  966.         #define TARGET_CPU_MIPS  0
  967.         #define TARGET_CPU_SPARC 0
  968.         #define TARGET_CPU_ALPHA 0
  969.     #elif defined(TARGET_CPU_68K) && TARGET_CPU_68K
  970.         #define TARGET_CPU_PPC   0
  971.         #define TARGET_CPU_X86   0
  972.         #define TARGET_CPU_MIPS  0
  973.         #define TARGET_CPU_SPARC 0
  974.         #define TARGET_CPU_ALPHA 0
  975.     #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
  976.         #define TARGET_CPU_PPC   0
  977.         #define TARGET_CPU_68K   0
  978.         #define TARGET_CPU_MIPS  0
  979.         #define TARGET_CPU_SPARC 0
  980.         #define TARGET_CPU_ALPHA 0
  981.     #elif defined(TARGET_CPU_MIPS) && TARGET_CPU_MIPS
  982.         #define TARGET_CPU_PPC   0
  983.         #define TARGET_CPU_68K   0
  984.         #define TARGET_CPU_X86   0
  985.         #define TARGET_CPU_SPARC 0
  986.         #define TARGET_CPU_ALPHA 0
  987.     #elif defined(TARGET_CPU_SPARC) && TARGET_CPU_SPARC
  988.         #define TARGET_CPU_PPC   0
  989.         #define TARGET_CPU_68K   0
  990.         #define TARGET_CPU_X86   0
  991.         #define TARGET_CPU_MIPS  0
  992.         #define TARGET_CPU_ALPHA 0
  993.     #elif defined(TARGET_CPU_ALPHA) && TARGET_CPU_ALPHA
  994.         #define TARGET_CPU_PPC   0
  995.         #define TARGET_CPU_68K   0
  996.         #define TARGET_CPU_X86   0
  997.         #define TARGET_CPU_MIPS  0
  998.         #define TARGET_CPU_SPARC 0
  999.  
  1000.         
  1001.     #else
  1002.         /*
  1003.             NOTE:    If your compiler errors out here then support for your compiler 
  1004.                     has not yet been added to ConditionalMacros.h.  
  1005.                     
  1006.                     ConditionalMacros.h is designed to be plug-and-play.  It auto detects
  1007.                     which compiler is being run and configures the TARGET_ conditionals
  1008.                     appropriately.  
  1009.                     
  1010.                     The short term work around is to set the TARGET_CPU_ and TARGET_OS_
  1011.                     on the command line to the compiler (e.g. d TARGET_CPU_MIPS -d TARGET_OS_UNIX)
  1012.                     
  1013.                     The long term solution is to add a new case to this file which
  1014.                     auto detects your compiler and sets up the TARGET_ conditionals.
  1015.                     If you do this, send the changes you made to devsupport@apple.com
  1016.                     to get it integrated into the next release of ConditionalMacros.h.
  1017.         */
  1018.         #error ConditionalMacros.h: unknown compiler (see comment above)
  1019.         #define TARGET_CPU_PPC   0
  1020.         #define TARGET_CPU_68K   0
  1021.         #define TARGET_CPU_X86   0
  1022.         #define TARGET_CPU_MIPS  0
  1023.         #define TARGET_CPU_SPARC 0
  1024.         #define TARGET_CPU_ALPHA 0
  1025.     #endif
  1026.     
  1027.  
  1028.  
  1029.     #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
  1030.         #define TARGET_OS_WIN32  0
  1031.         #define TARGET_OS_UNIX   0
  1032.     #elif defined(TARGET_OS_WIN32) && TARGET_OS_WIN32
  1033.         #define TARGET_OS_MAC    0
  1034.         #define TARGET_OS_UNIX   0
  1035.     #elif defined(TARGET_OS_UNIX) && TARGET_OS_UNIX
  1036.         #define TARGET_OS_MAC    0
  1037.         #define TARGET_OS_WIN32  0
  1038.     #elif TARGET_CPU_PPC || TARGET_CPU_68K
  1039.         #define TARGET_OS_MAC    1
  1040.         #define TARGET_OS_WIN32  0
  1041.         #define TARGET_OS_UNIX   0
  1042.     #else
  1043.         #error ConditionalMacros.h: unknown target OS (see comment above)
  1044.     #endif
  1045.  
  1046.     #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1047.         #if TARGET_OS_MAC
  1048.             #define TARGET_RT_LITTLE_ENDIAN        0
  1049.             #define TARGET_RT_BIG_ENDIAN        1
  1050.         #elif TARGET_OS_WIN32
  1051.             #define TARGET_RT_LITTLE_ENDIAN        1
  1052.             #define TARGET_RT_BIG_ENDIAN        0
  1053.         #endif
  1054.     #endif
  1055.         
  1056.     #if defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1057.         #define TARGET_RT_LITTLE_ENDIAN        !TARGET_RT_BIG_ENDIAN
  1058.     #elif !defined(TARGET_RT_BIG_ENDIAN) && defined(TARGET_RT_LITTLE_ENDIAN)
  1059.         #define TARGET_RT_BIG_ENDIAN        !TARGET_RT_LITTLE_ENDIAN
  1060.     #endif
  1061.     
  1062.     #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1063.         #error unknown endianess of target processor
  1064.     #endif
  1065.  
  1066.     #ifndef TARGET_RT_MAC_CFM
  1067.     #define TARGET_RT_MAC_CFM            TARGET_CPU_PPC
  1068.     #endif
  1069.     #ifndef TARGET_RT_MAC_68881
  1070.     #define TARGET_RT_MAC_68881            0
  1071.     #endif
  1072.  
  1073.         
  1074.     #ifndef PRAGMA_IMPORT
  1075.     #define PRAGMA_IMPORT                0
  1076.     #endif
  1077.     #ifndef PRAGMA_STRUCT_ALIGN
  1078.     #define PRAGMA_STRUCT_ALIGN            0
  1079.     #endif
  1080.     #ifndef PRAGMA_ONCE
  1081.     #define PRAGMA_ONCE                    0
  1082.     #endif
  1083.     #ifndef PRAGMA_STRUCT_PACK
  1084.     #define PRAGMA_STRUCT_PACK            0
  1085.     #endif
  1086.     #ifndef PRAGMA_STRUCT_PACKPUSH
  1087.     #define PRAGMA_STRUCT_PACKPUSH        0
  1088.     #endif
  1089.     #ifndef PRAGMA_ENUM_PACK
  1090.     #define PRAGMA_ENUM_PACK            0
  1091.     #endif
  1092.     #ifndef PRAGMA_ENUM_ALWAYSINT
  1093.     #define PRAGMA_ENUM_ALWAYSINT        0
  1094.     #endif
  1095.     #ifndef PRAGMA_ENUM_OPTIONS
  1096.     #define PRAGMA_ENUM_OPTIONS            0
  1097.     #endif
  1098.     #ifndef FOUR_CHAR_CODE
  1099.     #define FOUR_CHAR_CODE(x)            (x)
  1100.     #endif
  1101.  
  1102.     #ifndef TYPE_EXTENDED
  1103.     #define TYPE_EXTENDED                0
  1104.     #endif
  1105.     #ifndef TYPE_LONGLONG
  1106.     #define TYPE_LONGLONG                0
  1107.     #endif
  1108.     #ifndef TYPE_BOOL
  1109.     #define TYPE_BOOL                    0
  1110.     #endif
  1111. #endif
  1112.  
  1113.  
  1114.  
  1115.  
  1116. /****************************************************************************************************
  1117.  
  1118.     EXTERN_API≈    
  1119.     These conditionals are used to specify the calling convention of a function.
  1120.     Mac classic 68K and Win32 each have two possible calling conventions:
  1121.  
  1122.         EXTERN_API                - Classic 68K pascal, Win32 __cdecl
  1123.         EXTERN_API_C            - Classic 68K C,      Win32 __cdecl
  1124.         EXTERN_API_STDCALL        - Classic 68K pascal, Win32 __stdcall
  1125.         EXTERN_API_C_STDCALL    - Classic 68K C,      Win32 __stdcall
  1126.  
  1127.  
  1128.     CALLBACK_API≈    
  1129.     These conditionals are used to specify the calling convention of a function pointer.
  1130.     Mac classic 68K and Win32 each have two possible calling conventions:
  1131.  
  1132.         CALLBACK_API            - Classic 68K pascal, Win32 __stdcall
  1133.         CALLBACK_API_C            - Classic 68K C,      Win32 __stdcall
  1134.         CALLBACK_API_STDCALL    - Classic 68K pascal, Win32 __cdecl
  1135.         CALLBACK_API_C_STDCALL    - Classic 68K C,      Win32 __cdecl
  1136.  
  1137. ****************************************************************************************************/
  1138. #if TARGET_OS_MAC
  1139.     /*
  1140.         Mac OS
  1141.     */
  1142.     #define EXTERN_API(_type)                        extern pascal _type        /* Note: all Mac OS compilers must be able to handle the pascal keyword */
  1143.     #define EXTERN_API_C(_type)                        extern _type
  1144.     #define EXTERN_API_STDCALL(_type)                extern pascal _type
  1145.     #define EXTERN_API_C_STDCALL(_type)                extern _type
  1146.     #define CALLBACK_API(_type, _name)                pascal _type (*_name)
  1147.     #define CALLBACK_API_C(_type, _name)            _type (*_name)
  1148.     #define CALLBACK_API_STDCALL(_type, _name)        pascal _type (*_name)
  1149.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (*_name)
  1150. #elif TARGET_OS_WIN32
  1151.     /*
  1152.         Win32 
  1153.     */
  1154.     #define EXTERN_API(_type)                        __declspec(dllimport) _type __cdecl
  1155.     #define EXTERN_API_C(_type)                        __declspec(dllimport) _type __cdecl
  1156.     #define EXTERN_API_STDCALL(_type)                __declspec(dllimport) _type __stdcall
  1157.     #define EXTERN_API_C_STDCALL(_type)                __declspec(dllimport) _type __stdcall
  1158.     #define CALLBACK_API(_type, _name)                _type (* __cdecl _name)
  1159.     #define CALLBACK_API_C(_type, _name)            _type (* __cdecl _name)
  1160.     #define CALLBACK_API_STDCALL(_type, _name)        _type (* __stdcall _name)
  1161.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (* __stdcall _name)
  1162. #else
  1163.     /*
  1164.         Unix or anything else
  1165.     */
  1166.     #define EXTERN_API(_type)                        extern _type
  1167.     #define EXTERN_API_C(_type)                        extern _type
  1168.     #define EXTERN_API_STDCALL(_type)                extern _type
  1169.     #define EXTERN_API_C_STDCALL(_type)                extern _type
  1170.     #define CALLBACK_API(_type, _name)                _type (*_name)
  1171.     #define CALLBACK_API_C(_type, _name)            _type (*_name)
  1172.     #define CALLBACK_API_STDCALL(_type, _name)        _type (*_name)
  1173.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (*_name)    
  1174. #endif
  1175.  
  1176.  
  1177. /****************************************************************************************************
  1178.     Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  1179.  
  1180.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  1181.     GENERATING68K            - Compiler is generating 68k family instructions
  1182.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  1183.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  1184.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  1185.     PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  1186.     PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  1187.  
  1188. ****************************************************************************************************/
  1189. #if TARGET_OS_MAC
  1190. #define GENERATINGPOWERPC TARGET_CPU_PPC
  1191. #define GENERATING68K TARGET_CPU_68K
  1192. #define GENERATING68881 TARGET_RT_MAC_68881
  1193. #define GENERATINGCFM TARGET_RT_MAC_CFM
  1194. #define CFMSYSTEMCALLS TARGET_RT_MAC_CFM
  1195. #define PRAGMA_ALIGN_SUPPORTED    PRAGMA_STRUCT_ALIGN
  1196. #define PRAGMA_IMPORT_SUPPORTED PRAGMA_IMPORT
  1197. /*
  1198.     NOTE: The FOR_≈ conditionals were developed to produce integerated
  1199.           interface files for System 7 and Copland.  Now that Copland
  1200.           is canceled, all FOR_ conditionals have been removed from
  1201.           the interface files.  But, just in case you someone got an 
  1202.           interface file that uses them, the following sets the FOR_≈
  1203.           conditionals to a consistent, usable state.
  1204.  
  1205.     #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES        0
  1206.     #ifndef FOR_PTR_BASED_AE
  1207.         #define FOR_PTR_BASED_AE                    0
  1208.     #endif
  1209.     #define FOR_SYSTEM7_ONLY                        1
  1210.     #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED        1
  1211.     #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE        1
  1212.     #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE        1
  1213.     #define FOR_SYSTEM8_COOPERATIVE                    0
  1214.     #define FOR_SYSTEM8_PREEMPTIVE                    0
  1215. */
  1216. #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES     ..FOR_OPAQUE_SYSTEM_DATA_STRUCTURES_is_an_obsolete_Coplandism..
  1217. #define FOR_PTR_BASED_AE                     ..FOR_PTR_BASED_AE_is_an_obsolete_Coplandism..
  1218. #define FOR_SYSTEM7_ONLY                     ..FOR_SYSTEM7_ONLY_is_an_obsolete_Coplandism..
  1219. #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED     ..FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED_is_an_obsolete_Coplandism..
  1220. #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE ..FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE_is_an_obsolete_Coplandism..
  1221. #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE    ..FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE_is_an_obsolete_Coplandism..
  1222. #define FOR_SYSTEM8_COOPERATIVE             ..FOR_SYSTEM8_COOPERATIVE_is_an_obsolete_Coplandism..
  1223. #define FOR_SYSTEM8_PREEMPTIVE                 ..FOR_SYSTEM8_PREEMPTIVE_is_an_obsolete_Coplandism..
  1224. #endif  /* TARGET_OS_MAC */
  1225.  
  1226.  
  1227.  
  1228.  
  1229. /****************************************************************************************************
  1230.  
  1231.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  1232.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  1233.                               are now more sensitive to change because CFM binds by name.  In the 
  1234.                               past, system routine names were compiled out to just an A-Trap.  
  1235.                               Macros have been added that each map an old name to its new name.  
  1236.                               This allows old routine names to be used in existing source files,
  1237.                               but the macros only work if OLDROUTINENAMES is true.  This support
  1238.                               will be removed in the near future.  Thus, all source code should 
  1239.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  1240.                               to see if your code has any old names left in it.
  1241.     
  1242.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  1243.                               has been moved from Strings to TextUtils.  It is conditionalized in
  1244.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  1245.                               This allows developers to upgrade to newer interface files without 
  1246.                               having to change the includes in their source code.  But, it allows
  1247.                               the slow migration of system calls to more understandable file locations.  
  1248.                               OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  1249.                               default to false.
  1250.  
  1251. ****************************************************************************************************/
  1252. #ifndef OLDROUTINENAMES
  1253. #define OLDROUTINENAMES 0
  1254. #endif  /*  ! defined(OLDROUTINENAMES)  */
  1255.  
  1256. #ifndef OLDROUTINELOCATIONS
  1257. #define OLDROUTINELOCATIONS 0
  1258. #endif  /*  ! defined(OLDROUTINELOCATIONS)  */
  1259.  
  1260.  
  1261.  
  1262. /****************************************************************************************************
  1263.     C specific conditionals
  1264.  
  1265.     CGLUESUPPORTED            - Interface library will support "C glue" functions (function names
  1266.                               are: all lowercase, use C strings instead of pascal strings, use 
  1267.                               Point* instead of Point).
  1268.  
  1269. ****************************************************************************************************/
  1270. #ifndef CGLUESUPPORTED
  1271. #if TARGET_OS_MAC && !defined(THINK_C)
  1272. #define CGLUESUPPORTED 1
  1273. #else
  1274. #define CGLUESUPPORTED 0
  1275. #endif  /* TARGET_OS_MAC &&  ! defined(THINK_C)  */
  1276.  
  1277. #endif  /*  ! defined(CGLUESUPPORTED)  */
  1278.  
  1279.  
  1280.  
  1281. /****************************************************************************************************
  1282.     The following macros isolate the use of 68K inlines in function prototypes.
  1283.     On the Mac OS under the Classic 68K runtime, function prototypes were followed
  1284.     by a list of 68K opcodes which the compiler inserted in the generated code instead
  1285.     of a JSR.  Under Classic 68K on the Mac OS, this macro will put the opcodes
  1286.     in the right syntax.  For all other OS's and runtimes the macro suppress the opcodes.
  1287.     Example:
  1288.     
  1289.         EXTERN_P void DrawPicture(PicHandle myPicture, const Rect *dstRect)
  1290.              ONEWORDINLINE(0xA8F6);
  1291.     
  1292. ****************************************************************************************************/
  1293.  
  1294. #if TARGET_OS_MAC && !TARGET_RT_MAC_CFM
  1295.     #define ONEWORDINLINE(w1) = w1
  1296.     #define TWOWORDINLINE(w1,w2) = {w1,w2}
  1297.     #define THREEWORDINLINE(w1,w2,w3) = {w1,w2,w3}
  1298.     #define FOURWORDINLINE(w1,w2,w3,w4)  = {w1,w2,w3,w4}
  1299.     #define FIVEWORDINLINE(w1,w2,w3,w4,w5) = {w1,w2,w3,w4,w5}
  1300.     #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)     = {w1,w2,w3,w4,w5,w6}
  1301.     #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)      = {w1,w2,w3,w4,w5,w6,w7}
  1302.     #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)      = {w1,w2,w3,w4,w5,w6,w7,w8}
  1303.     #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9}
  1304.     #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)  = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10}
  1305.     #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11}
  1306.     #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12}
  1307. #else
  1308.     #define ONEWORDINLINE(w1)
  1309.     #define TWOWORDINLINE(w1,w2)
  1310.     #define THREEWORDINLINE(w1,w2,w3)
  1311.     #define FOURWORDINLINE(w1,w2,w3,w4)
  1312.     #define FIVEWORDINLINE(w1,w2,w3,w4,w5)
  1313.     #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)
  1314.     #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)
  1315.     #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)
  1316.     #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)
  1317.     #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)
  1318.     #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)
  1319.     #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)
  1320. #endif
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326. #endif /* __CONDITIONALMACROS__ */
  1327.  
  1328.